
#include "apue.h"
#include <ctype.h>

int main(void)
{
    int c;

    while ((c = getchar()) != EOF)
    {
        if (isupper(c))
        {
            c = tolower(c);
        }

        if (putchar(c) == EOF)
        {
            err_sys("output error");
        }

        if ('\n' == c)
        {
            fflush(stdout);
        }
    }

    exit(0);
}
